//
//  YFMomentModel.h
//  CoollangTennisBall
//
//  Created by Coollang on 2017/9/18.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Realm/Realm.h>
#import <YYKit/YYKit.h>
#import "JCMomentsModel.h"
#import "YFMomentResponseModel.h"


@interface YFMomentModel : RLMObject

@property NSString *userName;           //用户名
@property NSString *userID;             //用户ID
@property NSString *topicID;            //帖子ID
@property NSString *icon;               //头像
@property NSString *text;               //文本内容

@property double longitude;             //经度
@property double latitude;              //纬度
@property NSString *address;            //地址
@property NSString *createTime;         //创建时间
@property BOOL isLike;                  //自己是否点过赞
@property BOOL isHandpicked;            //是否是精选

@property RLMArray <YFMomentImageModel> *images;              //图片url数组
@property RLMArray <YFMomentResponseModel> *responseList;   // 评论和回复列表
@property RLMArray <YFMomentsPersonModel> *likeList;           //点赞人数


/*---------------------------------------------*/
@property (nonatomic, strong) NSMutableAttributedString *likesString;         //点赞人

/*--------------------以下属性不存储到本地-------------------------*/
@property (nonatomic, assign) BOOL isMyMoment;              //是否是我发的帖子
@property (nonatomic, assign) BOOL isNeedShowMoreBtn;       //是否需要显示更多
@property (nonatomic, assign) CGSize singleImageSize;       //单张图片时的size
@property (nonatomic, assign) ShowMoreBtnSate showMoreSate; //[显示更多]button的状态
@property (nonatomic, assign) CGFloat   normalCellHeight;   //cell高度
@property (nonatomic, assign) CGFloat   showMoreCellHeight; //cell高度
@property (nonatomic, assign) CGFloat   textLabelHeight;    //文本高度
@property (nonatomic, assign) CGFloat   imagesHeight;       //图片高度
@property (nonatomic, assign) CGFloat   timeAdressHeight;   //时间地址高度
@property (nonatomic, assign) CGFloat   likeHeight;         //点赞高度
@property (nonatomic, assign) CGFloat   commentHeigh;       //评论高度

+ (void)addOrUpadteMoments:(NSArray <YFMomentModel *>*)moments;

+ (RLMResults *)getMomemnts;

- (void)parseMomentModelWithDict:(NSDictionary *)dict;

/*
*
* 计算cell的高度
*/
- (void)calculCellheightRecalcul:(BOOL)recalculAll;

/**
 点赞、取消赞
 @param         state        YES:点赞 NO:取消赞
 */
- (void)editLikeState:(BOOL)state;
/**
 添加一条评论
 @param         model        评论数据模型
 */
- (void)addCommentModel:(YFMomentResponseModel *)model;
/**
 添加一条回复
 @param         model        回复数据模型
 */
- (void)addResponseModel:(YFMomentResponseModel *)model;


@end
RLM_ARRAY_TYPE(YFMomentModel)





